package com.rd.student.dashuju.wangbo.exercise02;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Random;

public class Score {

    public static void main(String[] args) {
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        ArrayList<Integer> arrayListId = new ArrayList<>();
        ArrayList<Integer> arrayListScore = new ArrayList<>();
        studentlist(hashMap);
    }

    public static void studentlist(HashMap<Integer,Integer> hashMap){
        Random random = new Random();
        int id = 1;
        int max = 0;
        for (int i = 1; i <= 20; i++) {
            id = i;
            int score = random.nextInt(101);
            hashMap.put(id,score);
            System.out.println(id + "," +score);
            max = Collections.max(hashMap.values());

            System.out.println(max);
            }
        }
    }

